import QtQuick 1.0

/**
 * Multiple properties are allowed, as is mixing "local" and aliased properties.
 */

Rectangle {
	width: 300
	height: 300

	PersistentObject {
		id: storedObject

		// Local properties
		property string someString: "initial text"
		property int someInt: 3
		property bool someBool: true
		property variant someArray: [1,2,3]
		property variant someObject: {"foo": "bar", "nut": "bolt"}

		// Aliased property
		property alias someText: textInput.text
	}

	Column {
		TextInput {
			text: storedObject.someObject.nut // This works
			onTextChanged: storedObject.someObject.nut = text // But this doesn't work, the object is never updated. Bug in QtQuick?
		}

		TextInput {
			id: textInput
			text: "initial text"
		}
	}
}
